package com.atguigu.gmall.user.rpc;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.user.entity.UserAddress;
import com.atguigu.gmall.user.service.UserAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lfy
 * @Description
 * @create 2022-10-19 14:16
 */
@RequestMapping("/api/inner/user")
@RestController
public class UserRpcController {

    @Autowired
    UserAddressService userAddressService;


    /**
     * 用户收货地址列表
     * @return
     */
    @GetMapping("/address/list")
    public Result<List<UserAddress>> getUserAddress(){

        List<UserAddress> userAddressList = userAddressService.getUserAddressByUserId();

        return Result.ok(userAddressList);
    }
}
